# -*- coding: utf-8 -*-
# @Time : 2024/1/14 7:34 PM 
# @Author : Wayne
# @Email : 1
# @File : new_sqlServer.py
# @Project : pythonYoungWeb
# @DESCRIPTION :
import jaydebeapi

jdbc_url = "jdbc:jtds:sqlserver://70323oszj483.vicp.fun:18951/AIS20180421081721"
driver_name = "net.sourceforge.jtds.jdbc.Driver"
username = 'ffsyuser'
password = 'qwaz123.'

# 确保jtds.jar在classpath中，这里是相对路径示例
jar_path = './lib/jtds-1.3.1.jar'

conn = jaydebeapi.connect(driver_name, jdbc_url, [username, password], jar_path)

cursor = conn.cursor()
SQL_QUERY = "SELECT * FROM dbo.t_IcItem WHERE FShortNumber = '03'"
cursor.execute(SQL_QUERY)

records = cursor.fetchall()

for r in records:
    print(r)